<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>导航菜单</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .box {
        width: 800px;
        height: 500px;
        margin: 100px auto;
    }

    .nav li {
        width: 100px;
        height: 40px;
        cursor: pointer;
        text-align: center;
        line-height: 40px;
        padding: 0 15px;
        border-radius: 45px;
        margin: 5px 0;
    }

    .nav>li {
        float: left;
        position: relative;
    }

    .nav>li:hover {
        background-color: aquamarine;
    }

    .nav>li:hover ul {
        /* 差点把这个都忘记了*/
        display: block;
    }

    .nav ul {
        position: absolute;
        display: none;
        left: 0;
        top: 40px;
    }

    .nav ul li:hover {
        background-color: aquamarine;
    }
</style>

<body>
    <div class="box">
        <ul class="nav">
            <li>一级菜单
                <ul>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                </ul>
            </li>
            <li>一级菜单</li>
            <li>一级菜单
                <ul>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                </ul>
            </li>
            <li>一级菜单
                <ul>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                </ul>
            </li>
            <li>一级菜单
                <ul>
                    <li>二级菜单</li>
                    <li>二级菜单</li>
                </ul>
            </li>
        </ul>
    </div>
</body>

</html>